package org.dromara.system.domain.vo;

import org.dromara.common.excel.annotation.ExcelValid;
import org.dromara.common.excel.annotation.OnlyOne;
import org.dromara.system.domain.SysCommonFields;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;


/**
 * 常用字段视图对象 sys_common_fields
 *
 * @author yilong.fu
 * @date 2024-11-24
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ExcelIgnoreUnannotated
@AutoMapper(target = SysCommonFields.class)
public class SysCommonFieldsVo extends BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private Long id;

    /**
     * 列说明
     */
    @ExcelProperty(value = "列说明")
    @ExcelValid
    private String fieldName;

    /**
     * 列名
     */
    @ExcelProperty(value = "列名")
    @OnlyOne
    @ExcelValid
    private String field;

    /**
     * 类型
     */
    @ExcelProperty(value = "类型")
    @ExcelValid
    private String dataType;

    /**
     * 长度
     */
    @ExcelProperty(value = "长度")
    private String dataLength;

    /**
     * 是否为空（1允许，0不允许）
     */
    @ExcelProperty(value = "是否为空", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "1=允许,0=不允许")
    @ExcelValid
    private Long allowNull;

    /**
     * 描述说明
     */
    @ExcelProperty(value = "描述说明")
    private String description;

    /**
     * 排序
     */
    @ExcelProperty(value = "排序")
    private Integer seq;


}
